package cn.cdiothree.service;

import cn.cdiothree.dto.OrderDto;
import cn.cdiothree.dataobject.ProductOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author CumThing
 * @since 2020-02-02
 */
public interface ProductOrderService extends IService<ProductOrder>{

    /**
     * 创建订单
     * @param orderDTO
     * @return
     */
    OrderDto create(OrderDto orderDTO);

    /**
     * 根据订单id查询订单详情
     * @param orderId
     * @return
     */
    OrderDto findOne(String orderId);

    /**
     * 根据用户id查询订单列表
     * @param num
     * @param size
     * @param userId
     * @return
     */
    PageInfo<OrderDto> findList(int num, int size, Integer userId);

    /**
     * 取消订单
     * @param orderDTO
     * @return
     */
    OrderDto cancel(OrderDto orderDTO);

    /**
     * 完结订单
     * @param orderDTO
     * @return
     */
    OrderDto finish(OrderDto orderDTO);

    /**
     * 修改订单支付状态
     * @param orderDTO
     * @return
     */
    OrderDto paid(OrderDto orderDTO);

    /**
     * 卖家端查询订单
     * @param num
     * @param size
     * @return
     */
    PageInfo<OrderDto> findList(int num, int size);
}
